<template>
  <div id="NewsInfo">
    <div class="content">
      <h3 v-html="title"></h3>
      <span class="create-time">发布时间：{{date}}</span>
      <p v-html="content"></p>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'NewsInfo',
    data () {
      return {
        title: '',
        date: '',
        content: ''
      }

    },
    mounted () {
      document.body.scrollTop = 0;
      document.documentElement.scrollTop = 0;
      let cen=this.$route.query.centent;
      if(cen=="centent"){
        this.$fetch('notificationdetails', {id: this.$route.query.id})
          .then(response => {
              //成功获取服务器数据
              if (response.code === "200") {
                let data = response.data;
                this.title=data.title;
                this.date=data.createDate;// 截取时间
                this.content=data.content

              }
            }
          )
      }else{
        this.$fetch('newsdetails', {id: this.$route.query.id})
          .then(response => {
              //成功获取服务器数据
              if (response.code === "200") {
                let data = response.data;
                this.title=data.title
                this.date=data.createDate;// 截取时间
                this.content=data.content;

              }
            }
          )
      }

    }
}

</script>

<style lang="scss">
@import 'publicLib/scss/defualtScss.scss';

#NewsInfo {
  text-align: center;
  .content{
    .create-time{
      font-size: $font-size-normol - 0.1rem;
      margin: 0.5rem 0;
      display: block;
    }

    p{
      font-size: $font-size-default + 0.1rem;
      text-align: left;
      font-size:1rem;
      width:53.56rem;
      color:#495060;
        img{
           width:53.56rem;
        }
    }
  }
}
//.content p div{
 // width:53.56rem;
//}
//.content p div img {
// width:53.56rem;
//}
</style>
